package com_djm_2025_06_09.myString.StringBuilderDemo;

public class StringBuilderDemo3 {
    public static void main(String[] args) {
        //创建对象
        StringBuilder stringBuilder = new StringBuilder("abc");

        //添加元素
        stringBuilder.append(1);
        stringBuilder.append(2.3);
        stringBuilder.append(true);

        //反转
        stringBuilder.reverse();

        //获取长度
        int len = stringBuilder.length();
        System.out.println(len);

        //打印
        System.out.println(stringBuilder);
    }
}
